package com.asynctm.android.common.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;

import com.asynctm.android.R;
import com.asynctm.android.about.activity.AboutActivity;
import com.asynctm.android.common.application.BaseActivity;
import com.asynctm.android.socialnetwork.activity.SocialNetworkActivity;
import com.asynctm.android.tm.activity.TaskManagerActivity;

/**
 * Actividad principal de la aplicacion
 * 
 * @author rockdrigo
 */
public class AppMenuActivity extends BaseActivity implements OnClickListener {

	private final String LOG_TAG = AppMenuActivity.class.getSimpleName()
			.toString();

	private AppMenuViewHolder appMenuViewHolder;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.app_menu);
		setName(LOG_TAG);

		appMenuViewHolder = new AppMenuViewHolder(this);
		appMenuViewHolder.setOnClickListener(this);

	}

	@Override
	public void onClick(View v) {

		Intent intent = null;

		if (v == appMenuViewHolder.getBtnTask()) {
			intent = new Intent(AppMenuActivity.this, TaskManagerActivity.class);
		} else if (v == appMenuViewHolder.getBtnSocial()) {
			intent = new Intent(AppMenuActivity.this,
					SocialNetworkActivity.class);
		} else if (v == appMenuViewHolder.getBtnAbout()) {
			intent = new Intent(AppMenuActivity.this, AboutActivity.class);
		}

		if (intent != null) {
			startActivity(intent);
		}

	}

}
